package com.cd2cd.code_template.code_template.mapper;

import java.util.List;

import com.cd2cd.code_template.vo.SysRouteVo;
import org.apache.ibatis.annotations.Mapper;

import com.cd2cd.code_template.code_template.domain.SysRole;
import com.cd2cd.code_template.code_template.mapper.gen.SuperSysRoleMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SysRoleMapper extends SuperSysRoleMapper {

    List<SysRole> querySysUserRoles(Integer roleId);

    @Select("select count(1) from sys_user where del_flag = 'ok' and id in (select user_id from sys_relation_user where type = 'role' and id = #{roleId})")
    @ResultType(Integer.class)
    int haveRelation(@Param("roleId") Integer roleId);
}